from google.appengine.ext import db
import logging

class User(db.Model):
  email = db.StringProperty()
  first_name = db.StringProperty()
  last_name = db.StringProperty()
  school = db.StringProperty()
  role = db.StringProperty()
  confirmed = db.BooleanProperty()
  created = db.DateTimeProperty(auto_now_add=True)
  modified = db.DateTimeProperty(auto_now=True)
  # These four fields are the subjects under each teaching level.
  # TODO(sdd): Combine these into a single "subjects" field.
  primary = db.ListProperty(item_type=unicode)
  ordinary = db.ListProperty(item_type=unicode)
  advanced = db.ListProperty(item_type=unicode)
  teacher_training = db.ListProperty(item_type=unicode)

  def user_id(self):
    return self.key()
